<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/acceptance/Acceptance.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/acceptance/Acceptance.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'AcceptanceId',
                footer: "Foots",
                cnName: '物资领用表',
                name: 'acceptance/Acceptance',
                url: "/Acceptance/",
                sortName: "AccpetanceTime"
            });
            const editFormFields = ref({"Title":"","Describe":"","Remark":"","Article":"","Goods_name":"","Type":"","Material":"","Specification":"","City_Id":"","Num":"","Acceptance_Num":""});
            const editFormOptions = ref([[{"title":"物资领用标题","required":true,"field":"Title","type":"text"}],
                              [{"title":"物资领用描述","required":true,"field":"Describe","type":"textarea"}],
                              [{"title":"备注，其他额外信息","required":true,"field":"Remark","type":"textarea"}],
                              [{"dataKey":"物品下拉框","data":[],"title":"领用物品","required":true,"field":"Article","type":"select"}],
                              [{"title":"货物名称","required":true,"field":"Goods_name","type":"text"}],
                              [{"dataKey":"入库类型","data":[],"title":"类型","required":true,"field":"Type","type":"select"}],
                              [{"dataKey":"入库材质","data":[],"title":"材质","required":true,"field":"Material","type":"select"}],
                              [{"dataKey":"规格下拉框","data":[],"title":"货物规格","required":true,"field":"Specification","type":"select"}],
                              [{"dataKey":"产地-市","data":[],"title":"产地","required":true,"field":"City_Id","type":"select"}],
                              [{"title":"仓库数量","required":true,"field":"Num","type":"text"}],
                              [{"title":"领用数量","required":true,"field":"Acceptance_Num","type":"text"}]]);
            const searchFormFields = ref({"Accpetance_Person":"","AccpetanceTime":"","Approver":"","AuditStatus":""});
            const searchFormOptions = ref([[{"title":"领用人姓名","field":"Accpetance_Person","type":"like"},{"title":"领用时间","field":"AccpetanceTime","type":"date"}],[{"title":"审批人姓名","field":"Approver","type":"like"},{"dataKey":"审批状态下拉框","data":[],"title":"审批状态","field":"AuditStatus","type":"select"}]]);
            const columns = ref([{field:'AcceptanceId',title:'主键ID，使用UUID作为唯一标识符',type:'string',width:120,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Title',title:'物资领用标题',type:'string',width:120,require:true,align:'left',sort:true},
                       {field:'Describe',title:'物资领用描述',type:'string',width:120,require:true,align:'left'},
                       {field:'Remark',title:'备注，其他额外信息',type:'string',width:120,require:true,align:'left'},
                       {field:'Article',title:'领用物品',type:'string',bind:{ key:'物品下拉框',data:[]},width:120,require:true,align:'left'},
                       {field:'Acceptance_Num',title:'领用数量',type:'int',width:120,require:true,align:'left'},
                       {field:'Accpetance_Person',title:'领用人姓名',type:'string',width:120,require:true,align:'left'},
                       {field:'AccpetanceTime',title:'领用时间',type:'date',width:120,require:true,align:'left',sort:true},
                       {field:'Approver',title:'审批人姓名',type:'string',width:120,require:true,align:'left'},
                       {field:'AuditStatus',title:'审批状态',type:'int',bind:{ key:'审批状态下拉框',data:[]},width:120,require:true,align:'left'},
                       {field:'CreateTime',title:'记录创建时间',type:'datetime',width:120,require:true,align:'left',sort:true},
                       {field:'UpdatedTime',title:'记录最后更新时间',type:'datetime',width:120,require:true,align:'left',sort:true},
                       {field:'CreatedName',title:'记录创建者',type:'string',width:120,require:true,align:'left'},
                       {field:'UpdatedName',title:'记录最后更新者',type:'string',width:120,require:true,align:'left'},
                       {field:'Is_Deleted',title:'逻辑删除标志, 0表示未删除，1表示已删除',type:'int',width:120,hidden:true,require:true,align:'left'},
                       {field:'Goods_name',title:'货物名称',type:'string',width:120,hidden:true,require:true,align:'left'},
                       {field:'Type',title:'类型',type:'int',bind:{ key:'入库类型',data:[]},width:120,hidden:true,require:true,align:'left'},
                       {field:'Material',title:'材质',type:'int',bind:{ key:'入库材质',data:[]},width:120,hidden:true,require:true,align:'left'},
                       {field:'Specification',title:'货物规格',type:'string',bind:{ key:'规格下拉框',data:[]},width:120,hidden:true,require:true,align:'left'},
                       {field:'City_Id',title:'产地',type:'string',bind:{ key:'产地-市',data:[]},width:120,hidden:true,require:true,align:'left'},
                       {field:'Num',title:'仓库数量',type:'int',width:120,hidden:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
